<%@page import="cn.qidisoft.edu.hzjt.model.Student"%>
<%@ page language="java" pageEncoding="UTF-8" buffer="16kb"%>
<%@ include file="/base.jsp"%>
<%@ include file="/module/taglibs.jsp"%>
<%@ include file="/module/nocache.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<%@ include file="/module/js.jsp"%>
<%@ include file="/module/orderField.jsp"%>
<script type="text/javascript" src="${basePath}/js/jquery.Huploadify.js"></script>
    <link href="${basePath}/css/Huploadify.css" rel="stylesheet">
    <script type="text/javascript" src="${basePath}/js/raty/jquery.raty.js"></script>
    <link href="${basePath}/js/raty/jquery.raty.css" rel="stylesheet">
<style>

table label.error {
    margin-left: 5px;
    width: auto;
    display: inline;
    color: red;
}
</style>
	<style type="text/css">
        .grid{font:12px arial,helvetica,sans-serif;border:1px solid #cccccc}
        .grid td{font:100% arial,helvetica,sans-serif;height:24px;padding:5px}
        .grid{width:100%;border-collapse:collapse}.grid th{background:#eeeeee;height:27px;line-height:27px;border:1px solid #cccccc;padding-left:5px}
        .grid td{border:1px solid #cccccc;padding-left:5px;text-align: center;}
    </style>
</head>
<body>
	<!-- 星级支部考核 -->
    <form action="#" name="Form" id="Form" method="post">
    	<input type="hidden" name="khid" id="khid"  class="inputText" value="${data.khid}"/>
		<table cellpadding="0" cellspacing="0" border="0" class="table-border" width="100%">
			<tr>
				<td class="table-header" colspan="4">星级支部考核</td>
			</tr>
			<tr>
				<td class="table-titleTD" style="width: 30%"><font style="color: red;">*</font>党支部:</td>
				<td class="table-contentTD">
					<select class="selectList" id="dzbid" disabled="disabled">
					  <option value ="">全部</option>
					  <c:forEach items="${dzbsel}" var="data">
						  <option value ="${data.zBID}">${data.dZBMC}</option>
					  </c:forEach>
					</select>
				</td>
			   	<td class="table-titleTD" style="width: 30%"><font style="color: red;">*</font>考核年度:</td>
				<td class="table-contentTD">
				<input type="number" name="khnd" id="khnd" autocomplete="off"  class="required inputText" value="${data.khnd}"/></td>
			</tr>
			<tr>
				<td class="table-titleTD" style="width: 30%">支部党员先锋指数上半年总分:</td>
				<td class="table-contentTD">
				<input type="number" id="sbnzf" name="sbnzf" autocomplete="off" readonly="readonly" maxlength="100" class="inputText" value="${data.sbnzf}"/></td>
		
			   	<td class="table-titleTD" style="width: 30%">支部党员先锋指数下半年总分:</td>
				<td class="table-contentTD">
				<input type="number" name="xbnzf" id="xbnzf" autocomplete="off" readonly="readonly" class="inputText" value="${data.xbnzf}" /></td>
			</tr>
			<tr>
				<td class="table-titleTD" style="width: 30%">支部党员先锋指数全年平均值:</td>
				<td class="table-contentTD">
				<input type="number" id="qnpjz" name="qnpjz" autocomplete="off" readonly="readonly" maxlength="100" class="inputText" value="${data.qnpjz}" /></td>
		
			   	<td class="table-titleTD" style="width: 30%">民主测评情况:</td>
				<td class="table-contentTD">
				<input type="text" name="mzcpqk" id="mzcpqk" autocomplete="off"  class="readonly" value="${data.mzcpqk}"/></td>
			</tr>
			<tr>
				<td class="table-titleTD" style="width: 30%">总支委员会考核情况:</td>
				<td class="table-contentTD">
				<input type="text" id="zzwyhkhqk" name="zzwyhkhqk" autocomplete="off" maxlength="100" class=" readonly" value="${data.zzwyhkhqk}"/></td>
			
				<td class="table-titleTD" style="width: 30%">其他考核情况:</td>
				<td class="table-contentTD">
				<input type="text" name="qtkhqk" id="qtkhqk" autocomplete="off" class="readonly" value="${data.qtkhqk}" /></td>
			</tr>
		    <tr>
				<td class="table-titleTD" style="width: 30%">星级:</td>
				<td colspan="3" class="table-contentTD"><div id="stars"></div></td>
			</tr>
			
		</table>
	</form>
	<input type="hidden" id="aa" value="${data.stars}"/>
	<!-- 操作表格 -->
		<br />
		<table cellpadding="1" cellspacing="1" border="0" align="left">
			<tr>
				<td><input type="button" id="returnBut" class="inputButton"
					value="返回" style="text-align: center;" /></td>
			</tr>
		</table>
		
	<script>
		var html;
		var year;
		window.onload = function() {
		   var now = new Date();
		   year = now.getFullYear();
		}
		
		$(document).ready(function() {
			var xxsl = $("#aa").val();
			$('#stars').raty({
		 		readOnly : true,
		 		number : 10,
                starOff : '${basePath}/js/raty/images/star-off.png',
                starOn  : '${basePath}/js/raty/images/star-on.png',
                score : parseInt(xxsl)
            });
			
			    var dzbidsel = "${data.dzbid}";
	            var dzbmcsel = '${dzb.dZBMC}';
	            console.log(dzbidsel+"$$"+dzbmcsel);
	            $("#dzbid").val(dzbidsel);
			
			$("#khnd").blur(function(){
				if($("#khnd").val()>2099 || $("#khnd").val()<2010){
					layer.alert("请输入值不在2010到2099之间");
					$("#khnd").val(year);
				}else{
					if($("#dzbid option:selected").val()!="" && $("#khnd").val() != ""){
						getScoreData();
					}
				}
			});
			
			//返回方法
			function backList(){
				window.location.href = "${basePath}/partyBranchStar/list";
			}
			
			
			//返回按钮
			$("#returnBut").click(function(){
				backList();
			});
			
				$("#khnd").blur(function(){
				if($("#khnd").val()>2099 || $("#khnd").val()<2010){
					layer.alert("请输入值不在2010到2099之间");
					$("#khnd").val(year);
				}else{
					if($("#dzbid option:selected").val()!="" && $("#khnd").val() != ""){
						getScoreData();
					}
				}
			});
			
			
		});//$(document).ready end
		//获取分数
		function getScoreData(){
			$.ajax({
				type:"post",
				url:"${basePath}/partyBranchStar/selZbdyfs3",
				data:{"year":$("#khnd").val(),"dzbid":$("#dzbid option:selected").val()},
				success:function(data){
					if(data.isExist!=null && data.isExist==0){
						$("#sbnzf").val(0);
						$("#xbnzf").val(0);
						$("#qnpjz").val(0);
						$("#stars").val(0);
						$("#mzcpqk").val("");
						$("#zzwyhkhqk").val("");
						$("#qtkhqk").val("");
					}else{
						$("#sbnzf").val(data.partyBranchStar.sbnzf);
						$("#xbnzf").val(data.partyBranchStar.xbnzf);
						$("#qnpjz").val(data.partyBranchStar.qnpjz);
						$("#stars").val(data.partyBranchStar.stars);
						$("#mzcpqk").val(data.partyBranchStar.mzcpqk);
						$("#zzwyhkhqk").val(data.partyBranchStar.zzwyhkhqk);
						$("#qtkhqk").val(data.partyBranchStar.qtkhqk);
					}
				}
			});
		}
		//点击弹出添加学生div
		function showdiv() {
			$('#div1').dialog('open');
		}
	</script>
</body>
</html>